home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48hor1 / d2f.lst < prev    next >
File List  |  1991-06-13  |  4KB  |  108 lines

  1. D2F, a fast decimal-to-fraction converter, by Joseph K. Horn 
  2.  
  3. D2F is the same as DEC2FRAC (see DEC2FRAC.DOC) except it's written in
  4. "system RPL".  It's therefore shorter, faster, and not editable.
  5.  
  6. 02D9D ! Program
  7. 18EDF ;   Save current command, verify DEPTH ≥ 2, check args.
  8. 04099 ;   <11h> Real, Real
  9. 02D9D !   Program
  10. 53B88 ;     Clear Numeric Results flag (-3)
  11. 031AC ;     Internal DUP2
  12. 22EC3 ;     IF (XLIB 1792 0)
  13. 2A2C9 ;       1
  14. 1ECDF ;       Internal > (2:Real,1:Real)
  15. 03223 ;       Internal SWAP
  16. 2AF4D ;       Internal FP (1:Real)
  17. 1E7DD ;       Internal AND (2:Real,1:Real)
  18. 22F22 ;     Internal THEN (1:Real)
  19. 02D9D !       Program
  20. 234C1 ;         -> (for Programs) (XLIB 1792 16) aka RPN->
  21. [...] !         'f' (Local Name)
  22. [...] !         'c' (Local Name)
  23. 2361E ;         « (XLIB 1792 18)
  24. 2A2B4 ;           0
  25. 2A2C9 ;           1
  26. [...] !           'f' (Local Name)
  27. 23033 ;           WHILE (XLIB 1792 5)
  28. 032C2 ;             Internal OVER (+2)
  29. [...] !             'c' (Local Name)
  30. 1EC40 ;             Internal < (2:Real,1:Real)
  31. 032C2 ;             Internal OVER (+2)
  32. 1E7DD ;             Internal AND (2:Real,1:Real)
  33. 23085 ;           Internal REPEAT (1:Real)
  34. 02D9D !             Program
  35. 2AAAF ;               Internal INV (1:Real)
  36. 03188 ;               Internal DUP
  37. 2AF4D ;               Internal FP (1:Real)
  38. 6109E ;               Internal 4 ROLLD (=1432)
  39. 2AF60 ;               Internal IP (1:Real)
  40. 032C2 ;               Internal OVER (+2)
  41. 2A9BC ;               Internal * (2:Real,1:Real)
  42. 03295 ;               Internal ROT
  43. 2A974 ;               Internal + (2:Real,1:Real)
  44. 03295 ;               Internal ROT
  45. 0312B !             End Marker
  46. 23694 ;           END (for WHILE) (XLIB 1792 22) aka WHILEEND
  47. 03244 ;           Internal DROP
  48. 031AC ;           Internal DUP2
  49. [...] !           'c' (Local Name)
  50. 22EC3 ;           IF (XLIB 1792 0)
  51. 031AC ;             Internal DUP2
  52. 1ECDF ;             Internal > (2:Real,1:Real)
  53. 22EFA ;           THEN (XLIB 1792 1)
  54. 02D9D !             Program
  55. 2A981 ;               Internal - (2:Real,1:Real)
  56. 032C2 ;               Internal OVER (+2)
  57. 2A9FE ;               Internal / (2:Real,1:Real)
  58. 2AF73 ;               Internal CEIL (1:Real)
  59. 2A9BC ;               Internal * (2:Real,1:Real)
  60. 2A981 ;               Internal - (2:Real,1:Real)
  61. 0312B !             End Marker
  62. 22FB5 ;           ELSE (XLIB 1792 2)
  63. 60F4B ;             Internal 3 DROPN
  64. 22FD5 ;           END (for IF) (XLIB 1792 3) aka IFEND
  65. 031AC ;           Internal DUP2
  66. 2A2C9 ;           1
  67. 2A2DE ;           2
  68. 23144 ;           Internal START (2:Real,1:Real)
  69. 03188 ;             Internal DUP
  70. [...] !             'f' (Local Name)
  71. 2A9BC ;             Internal * (2:Real,1:Real)
  72. 2A2B4 ;             0
  73. 2B529 ;             Internal RND (2:Real,1:Real)
  74. 03223 ;             Internal SWAP
  75. 2A9FE ;             Internal / (2:Real,1:Real)
  76. [...] !             'f' (Local Name)
  77. 503B1 ;             Internal -, ABS (2:Real,1:Real)
  78. 03223 ;             Internal SWAP
  79. 2324C ;           NEXT (XLIB 1792 11)
  80. 22EC3 ;           IF (XLIB 1792 0)
  81. 1ECDF ;             Internal > (2:Real,1:Real)
  82. 22F22 ;           Internal THEN (1:Real)
  83. 03223 ;             Internal SWAP
  84. 22FD5 ;           END (for IF) (XLIB 1792 3) aka IFEND
  85. 627A7 ;           Internal DROP DUP (=2)
  86. [...] !           'f' (Local Name)
  87. 2A9BC ;           Internal * (2:Real,1:Real)
  88. 2A2B4 ;           0
  89. 2B529 ;           Internal RND (2:Real,1:Real)
  90. 03223 ;           Internal SWAP
  91. 235FE ;         » (end local scope) (XLIB 1792 17) aka >>ABND
  92. 22EC3 ;         IF (XLIB 1792 0)
  93. 03188 ;           Internal DUP
  94. 2A900 ;           Internal ABS (1:Real)
  95. 2A2C9 ;           1
  96. 1ECDF ;           Internal > (2:Real,1:Real)
  97. 22F22 ;         Internal THEN (1:Real)
  98. 5603E ;           Internal / (2:Symbolic,1:Symbolic)
  99. 22FB5 ;         ELSE (XLIB 1792 2)
  100. 03244 ;           Internal DROP
  101. 22FD5 ;         END (for IF) (XLIB 1792 3) aka IFEND
  102. 0312B !       End Marker
  103. 22FB5 ;     ELSE (XLIB 1792 2)
  104. 03244 ;       Internal DROP
  105. 22FD5 ;     END (for IF) (XLIB 1792 3) aka IFEND
  106. 0312B !   End Marker
  107. 0312B ! End Marker
  108.